package kr.hkit.powerjava.chther10;

import javax.swing.JOptionPane;

public class ArrayTest1 {
	public static void main(String[] args) {
		final int STUDENTS =5;
		int total =0;
		
		int[] arrScores = new int[STUDENTS];
//		System.out.println(arrScores.length);3
		int sc = -1;
		
		for(int i=0;i<arrScores.length;i++){
//			String res = JOptionPane.showInputDialog("입력");
//			arrScores[i] = Integer.parseInt(res);
			
//			arrScores[i] =Integer.parseInt(JOptionPane.showInputDialog("점수입력 ㄱㄱ:"));
			arrScores[i]=i+1;
		}
//		prnArray(arrScores);
//		arrSum(arrScores);
//		arrScores[STUDENTS]=10;
		
		int [] arr = {1,2,3,4,5,6,7,8,9};
		System.out.println(arr.length);
		for(int i:arr){
			System.out.printf("%3d",i);
		}
	}

	private static void arrSum(int[] arrScores) {
		// TODO Auto-generated method stub
		int sum=0;
		for (int i = 0; i < arrScores.length; i++) {
			sum = sum+arrScores[i];
		}
		System.out.println("배열의 합"+sum);
	}

	private static void prnArray(int[] arrScores) {
		// TODO Auto-generated method stub
		for(int i=0;i<arrScores.length;i++){
			System.out.print("arrscores["+ i +"]"+arrScores[i]+"\t");
		}
		System.out.println();
	}
	
}
